(function() {
    'use strict';

    angular
        .module('byibserverApp')
        .controller('WcProductDetailController', WcProductDetailController);

    WcProductDetailController.$inject = ['$scope', '$rootScope', '$stateParams', 'previousState', 'entity', 'WcProduct', 'WcIsurer', 'WcInsuranceCategory'];

    function WcProductDetailController($scope, $rootScope, $stateParams, previousState, entity, WcProduct, WcIsurer, WcInsuranceCategory) {
        var vm = this;

        vm.wcProduct = entity;
        vm.previousState = previousState.name;

        var unsubscribe = $rootScope.$on('byibserverApp:wcProductUpdate', function(event, result) {
            vm.wcProduct = result;
        });
        $scope.$on('$destroy', unsubscribe);
    }
})();
